<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增用户')"/>
</head>
<body>
<div class="main-content">
    <form id="form-user-add" class="form-horizontal">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">路段选择</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select  id="road_name" name="road_name" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="road : ${pavementMaterislas.stringArrayRoadList}" th:text="${road}"
                                        th:value="${road}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">面层材料组合</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select id="roadCombinationOfSurfaceMaterial" name="roadCombinationOfSurfaceMaterial" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="surface : ${pavementMaterislas.stringArraySurfaceList}" th:text="${surface}"
                                        th:value="${surface}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">基层材料组合</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select id="roadCombinationOfBaseMaterial" name="roadCombinationOfBaseMaterial" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="base : ${pavementMaterislas.stringArrayBaseList}" th:text="${base}"
                                        th:value="${base}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
            </button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
            </button>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script>
    var prefixPavementMaterials=ctx +"road/pavement_materials";
    function submitHandler(){
        if ($.validate.form("form-user-add")){
            var road=$.form.selectSelects("road_name");
            var roadCombinationOfSurfaceMaterial=$.form.selectSelects("roadCombinationOfSurfaceMaterial");
            var roadCombinationOfBaseMaterial=$.form.selectSelects("roadCombinationOfBaseMaterial");
            var data={road:road,
                roadCombinationOfSurfaceMaterial:roadCombinationOfSurfaceMaterial,
                roadCombinationOfBaseMaterial:roadCombinationOfBaseMaterial}
            $.operate.post(prefixPavementMaterials+"/saveRoadPavementMaterialsInit",
                data);
        }
    };
</script>
</body>
</html>
